home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / QuickDraw 3D / Windows files / Q3WinSDK.exe / QD3DSDK / Interfaces / QD3DShader.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-20  |  8.1 KB  |  262 lines

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **     Module:        QD3DShader.h                                             **
  4.  **                                                                             **
  5.  **                                                                             **
  6.  **     Purpose:     QuickDraw 3D Shader / Color Routines                     **
  7.  **                                                                             **
  8.  **                                                                             **
  9.  **                                                                             **
  10.  **     Copyright (C) 1991-1996 Apple Computer, Inc. All rights reserved.     **
  11.  **                                                                             **
  12.  **                                                                             **
  13.  *****************************************************************************/
  14. #ifndef QD3DShader_h
  15. #define QD3DShader_h
  16.  
  17. #if defined(PRAGMA_ONCE) && PRAGMA_ONCE
  18.     #pragma once
  19. #endif
  20.  
  21. #if defined(THINK_C) || defined(__SC__)
  22.     #pragma options(!pack_enums, !align_arrays)
  23.     #pragma SC options align=power
  24. #elif defined(__MWERKS__)
  25.     #pragma enumsalwaysint on
  26.     #pragma align_array_members off
  27.     #pragma options align=native
  28. #elif defined(__PPCC__)
  29.     #pragma options align=power
  30. #elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
  31.     #pragma options enum=int
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif    /* __cplusplus */
  37.  
  38. /******************************************************************************
  39.  **                                                                             **
  40.  **                                RGB Color routines                             **
  41.  **                                                                             **
  42.  *****************************************************************************/
  43.  
  44. QD3D_EXPORT TQ3ColorRGB *QD3D_CALL Q3ColorRGB_Set(
  45.     TQ3ColorRGB            *color,
  46.     float                r,
  47.     float                g,
  48.     float                b);
  49.  
  50. QD3D_EXPORT TQ3ColorARGB *QD3D_CALL Q3ColorARGB_Set(
  51.     TQ3ColorARGB        *color,
  52.     float                a,
  53.     float                r,
  54.     float                g,
  55.     float                b);
  56.  
  57. QD3D_EXPORT TQ3ColorRGB *QD3D_CALL Q3ColorRGB_Add(
  58.     const TQ3ColorRGB     *c1, 
  59.     const TQ3ColorRGB     *c2,
  60.     TQ3ColorRGB            *result);
  61.  
  62. QD3D_EXPORT TQ3ColorRGB *QD3D_CALL Q3ColorRGB_Subtract(
  63.     const TQ3ColorRGB     *c1, 
  64.     const TQ3ColorRGB     *c2,
  65.     TQ3ColorRGB            *result);
  66.  
  67. QD3D_EXPORT TQ3ColorRGB *QD3D_CALL Q3ColorRGB_Scale(
  68.     const TQ3ColorRGB     *color, 
  69.     float                scale,
  70.     TQ3ColorRGB            *result);
  71.  
  72. QD3D_EXPORT TQ3ColorRGB *QD3D_CALL Q3ColorRGB_Clamp(
  73.     const TQ3ColorRGB     *color,
  74.     TQ3ColorRGB            *result);
  75.  
  76. QD3D_EXPORT TQ3ColorRGB *QD3D_CALL Q3ColorRGB_Lerp(
  77.     const TQ3ColorRGB     *first, 
  78.     const TQ3ColorRGB     *last, 
  79.     float                 alpha,
  80.     TQ3ColorRGB         *result);
  81.  
  82. QD3D_EXPORT TQ3ColorRGB *QD3D_CALL Q3ColorRGB_Accumulate(
  83.     const TQ3ColorRGB     *src, 
  84.     TQ3ColorRGB         *result);
  85.  
  86. QD3D_EXPORT float *QD3D_CALL Q3ColorRGB_Luminance(
  87.     const TQ3ColorRGB    *color, 
  88.     float                 *luminance);
  89.  
  90.  
  91. /******************************************************************************
  92.  **                                                                             **
  93.  **                                Shader Types                                 **
  94.  **                                                                             **
  95.  *****************************************************************************/
  96.  
  97. typedef enum TQ3ShaderUVBoundary {
  98.     kQ3ShaderUVBoundaryWrap,
  99.     kQ3ShaderUVBoundaryClamp
  100. } TQ3ShaderUVBoundary;
  101.  
  102.  
  103. /******************************************************************************
  104.  **                                                                             **
  105.  **                                Shader Routines                                 **
  106.  **                                                                             **
  107.  *****************************************************************************/
  108.  
  109. QD3D_EXPORT TQ3ObjectType QD3D_CALL Q3Shader_GetType(
  110.     TQ3ShaderObject            shader);
  111.  
  112. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shader_Submit(
  113.     TQ3ShaderObject            shader, 
  114.     TQ3ViewObject            view);
  115.  
  116. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shader_SetUVTransform(
  117.     TQ3ShaderObject            shader,
  118.     const TQ3Matrix3x3        *uvTransform);
  119.  
  120. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shader_GetUVTransform(
  121.     TQ3ShaderObject            shader,
  122.     TQ3Matrix3x3            *uvTransform);
  123.  
  124. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shader_SetUBoundary(
  125.     TQ3ShaderObject            shader,
  126.     TQ3ShaderUVBoundary        uBoundary);
  127.  
  128. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shader_SetVBoundary(
  129.     TQ3ShaderObject            shader,
  130.     TQ3ShaderUVBoundary        vBoundary);
  131.  
  132. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shader_GetUBoundary(
  133.     TQ3ShaderObject            shader,
  134.     TQ3ShaderUVBoundary        *uBoundary);
  135.  
  136. QD3D_EXPORT TQ3Status QD3D_CALL Q3Shader_GetVBoundary(
  137.     TQ3ShaderObject            shader,
  138.     TQ3ShaderUVBoundary        *vBoundary);
  139.  
  140.  
  141. /******************************************************************************
  142.  **                                                                             **
  143.  **                            Illumination Shader    Classes                         **
  144.  **                                                                             **
  145.  *****************************************************************************/
  146.  
  147. QD3D_EXPORT TQ3ObjectType QD3D_CALL Q3IlluminationShader_GetType(
  148.     TQ3ShaderObject                shader);
  149.  
  150. QD3D_EXPORT TQ3ShaderObject QD3D_CALL Q3PhongIllumination_New(
  151.     void);
  152.  
  153. QD3D_EXPORT TQ3ShaderObject QD3D_CALL Q3LambertIllumination_New(
  154.     void);
  155.  
  156. QD3D_EXPORT TQ3ShaderObject QD3D_CALL Q3NULLIllumination_New(
  157.     void);
  158.  
  159. /******************************************************************************
  160.  **                                                                             **
  161.  **                                 Surface Shader                                 **
  162.  **                                                                             **
  163.  *****************************************************************************/
  164.  
  165. QD3D_EXPORT TQ3ObjectType QD3D_CALL Q3SurfaceShader_GetType(
  166.     TQ3SurfaceShaderObject        shader);
  167.  
  168. /******************************************************************************
  169.  **                                                                             **
  170.  **        Texture Shader  - may use any type of Texture. (only 1 type in 1.0)     **
  171.  **                                                                             **
  172.  *****************************************************************************/
  173.  
  174. QD3D_EXPORT TQ3ShaderObject QD3D_CALL Q3TextureShader_New(
  175.     TQ3TextureObject            texture);
  176.  
  177. QD3D_EXPORT TQ3Status QD3D_CALL Q3TextureShader_GetTexture(
  178.     TQ3ShaderObject                shader,
  179.     TQ3TextureObject            *texture);
  180.  
  181. QD3D_EXPORT TQ3Status QD3D_CALL Q3TextureShader_SetTexture(
  182.     TQ3ShaderObject                shader,
  183.     TQ3TextureObject            texture);
  184.  
  185.  
  186. /******************************************************************************
  187.  **                                                                             **
  188.  **        Texture Objects - For 1.0, there  is 1 subclass: PixmapTexture.         **
  189.  **        More subclasses will be added in later releases.                     **
  190.  **            (e.g. PICTTexture, GIFTexture, MipMapTexture)                     **
  191.  **                                                                             **
  192.  *****************************************************************************/
  193.  
  194. QD3D_EXPORT TQ3ObjectType QD3D_CALL Q3Texture_GetType(
  195.     TQ3TextureObject        texture);
  196.  
  197. QD3D_EXPORT TQ3Status QD3D_CALL Q3Texture_GetWidth(
  198.     TQ3TextureObject        texture,
  199.     unsigned long            *width);
  200.  
  201. QD3D_EXPORT TQ3Status QD3D_CALL Q3Texture_GetHeight(
  202.     TQ3TextureObject        texture,
  203.     unsigned long            *height);
  204.  
  205.  
  206. /******************************************************************************
  207.  **                                                                             **
  208.  **        Pixmap Texture                                                         **
  209.  **            The TQ3StoragePixmap must contain a TQ3StorageObject that is a     **
  210.  **            Memory Storage ONLY for 1.0. We will support other storage          **
  211.  **            classes in later releases.                                         **
  212.  **                                                                             **
  213.  *****************************************************************************/
  214.  
  215. QD3D_EXPORT TQ3TextureObject QD3D_CALL Q3PixmapTexture_New(
  216.     const TQ3StoragePixmap    *pixmap);
  217.  
  218. QD3D_EXPORT TQ3Status QD3D_CALL Q3PixmapTexture_GetPixmap(
  219.     TQ3TextureObject        texture,
  220.     TQ3StoragePixmap        *pixmap);
  221.  
  222. QD3D_EXPORT TQ3Status QD3D_CALL Q3PixmapTexture_SetPixmap(
  223.     TQ3TextureObject        texture,
  224.     const TQ3StoragePixmap    *pixmap);
  225.  
  226.  
  227. /******************************************************************************
  228.  **                                                                             **
  229.  **        Mipmap Texture                                                         **
  230.  **                                                                             **
  231.  *****************************************************************************/
  232.  
  233. QD3D_EXPORT TQ3TextureObject QD3D_CALL Q3MipmapTexture_New(
  234.     const TQ3Mipmap            *mipmap);
  235.  
  236. QD3D_EXPORT TQ3Status QD3D_CALL Q3MipmapTexture_GetMipmap(
  237.     TQ3TextureObject        texture,
  238.     TQ3Mipmap                *mipmap);
  239.  
  240. QD3D_EXPORT TQ3Status QD3D_CALL Q3MipmapTexture_SetMipmap(
  241.     TQ3TextureObject        texture,
  242.     const TQ3Mipmap            *mipmap);
  243.  
  244.  
  245. #ifdef __cplusplus
  246. }
  247. #endif    /* __cplusplus */
  248.  
  249. #if defined(THINK_C) || defined(__SC__)
  250.     #pragma SC options align=reset
  251. #elif defined(__MWERKS__)
  252.     #pragma enumsalwaysint reset
  253.     #pragma align_array_members reset
  254.     #pragma options align=reset
  255. #elif  defined(__PPCC__)
  256.     #pragma options align=reset
  257. #elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
  258.     #pragma options enum=reset
  259. #endif
  260.  
  261. #endif  /*  QD3DShader_h  */
  262.